package com.wuhunyu.commonutils.check;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 邮箱校验工具类
 *
 * @author wuhunyu
 * @version 1.0
 * @date 2021-01-23 11:15
 */
public class EmailCheckUtil {

    public static boolean isEmail(String email){
        if (null == email || "".equals(email)) {
            return false;
        }
        String regEx1 = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
        Pattern p = Pattern.compile(regEx1);
        Matcher m = p.matcher(email);
        return m.matches();
    }

}
